package com.xr.wage.commonTools;

import com.bstek.dorado.common.*;
import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.DBStatement;
import com.bstek.dorado.view.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;

/**
 * classViewModel
 */
public class classViewModel extends DefaultViewModel {
  protected void doUpdateData(ParameterSet parameters, ParameterSet outParameters)
      throws Exception {
    // Add your code here
    super.doUpdateData(parameters, outParameters);
  }
  public void wageBackgroundRun_cancelRun(ParameterSet parameters, ParameterSet outParameters)
  throws Exception {
	  DBStatement dbs = new DBStatement();
	  Dataset ds=getDataset("datasetPsn");
	  dbs.setSql("update wa_psn set compute_state=0 where psn_id="+ds.getString("PSN_ID"));
	  dbs.execute();
      dbs.close();
  }
  public void wageBackgroundRun_cancelRunAll(ParameterSet parameters, ParameterSet outParameters)
  throws Exception {
	  DBStatement dbs = new DBStatement();
	  Dataset ds=getDataset("datasetPsn");
	  dbs.setSql("update wa_psn set compute_state=0 where compute_state=2 and send_id="+ds.parameters().getString("SEND_ID"));
	  dbs.execute();
      dbs.close();
  }
}
